// 多类名的使用
import classNames from 'classnames'
import PropTypes from 'prop-types'
type Props = {
  type: string
  className?: string
  onClick?: () => void
}
function Icon({ type, className, ...rest }: Props) {
  return (
    <div>
      <svg
        className={classNames('icon', className)}
        {...rest}
        aria-hidden="true"
      >
        <use xlinkHref={`#${type}`}></use>
      </svg>
    </div>
  )
}
// 检验Icon
Icon.propTypes = {
  type: PropTypes.string.isRequired,
}

export default Icon
